GATE CSE 2021 SET-2


Q51.

The relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the department to which the employee is assigned. Each employee is assigned to exactly one department. \textsf{emp($\underline{\textsf{empId}}$, name, gender, salary, deptId)} Consider the following SQL query: select deptId, count(*) from emp where gender = "female" and salary > (select avg(salary)from emp) group by deptId;The above query gives, for each department in the company, the number of female employees whose salary is greater than the average salary of
GateOverflow

Q52.

Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes P1 and P2, and each of the processes spawns two threads T1 and T2:int x = 0; // global Lock L1; // global main () { create a thread to execute foo( ); // Thread T1 create a thread to execute foo( ); // Thread T2 wait for the two threads to finish execution; print(x);} foo() { int y = 0; Acquire L1; x = x + 1; y = y + 1; Release L1; print (y);} Which of the following statement(s) is/are correct?[MSQ]
GateOverflow

Q53.

Let S be the following schedule of operations of three transactions T_1, T_2 \text{ and }T_3 in a relational database system: R_2(Y), R_1(X), R_3(Z), R_1(Y)W_1(X), R_2(Z), W_2(Y), R_3(X), W_3(Z) Consider the statements P and Q below: P: S is conflict-serializable. Q: If T_3 commits before T_1 finishes, then S is recoverable. Which one of the following choices is correct?
GateOverflow

Q54.

Consider the three-way handshake mechanism followed during TCP connection establishment between hosts P and Q. Let X and Y be two random 32-bit starting sequence numbers chosen by P and Q respectively. Suppose P sends a TCP connection request message to Q with a TCP segment having SYN bit =1, SEQ number =X, and ACK bit =0. Suppose Q accepts the connection request. Which one of the following choices represents the information present in the TCP segment header that is sent by Q to P?
GateOverflow